<?php if(!empty($monctdts)){?>
<div>
<div>
<?php echo $this->Form->input('listctdtcu', array('id'=>'listctdtcu','label'=>'Môn thuộc CTĐT cũ','type' => 'select', 'multiple' => 'multiple','options' =>$monctdts));?>
</div>
<?php echo $form->button('  >>  ',array('id'=>'buttonthem'));?>
<?php echo $form->button('  <<  ',array('id'=>'buttonxoa'));?>
<div>
<?php echo $this->Form->input('listmoncd', array('id'=>'listmoncd','label'=>'Môn chuyển đổi','type' => 'select', 'multiple' => 'multiple','options' =>array()));?>
</div>
<div>
	<?php echo $form->input('mon_id',array('name'=>'data[Mon][tenMon]','id'=>'mon','label'=>'Ds môn','type'=>'select','options'=>$newmons,'empty'=>'--Chọn môn--'));?>
</div>
<div id='dsco'>

</div>
<div id='dschua'></div>
<div id='dsmonxoa'></div>
<div id='dsmonthem'></div>
</div>
<?php echo $form->hidden('ctdt',array('value'=>$ctdt))?>
<script type="text/javascript">
$('#buttonthem').live('click',function(){
	
								$('#listctdtcu :selected').each(function(i, selected) {
					                val = $(selected).val();
					                text = $(selected).text();
					                $("#listctdtcu option[value='"+ val +"']").remove();
					                $("#listmoncd").append('<option value='+val+'>'+text+'</option>');
					                $("#dsmonxoa #"+val).remove();
					                $("#dsmonthem").append('<INPUT TYPE=HIDDEN id="'+val+'" name=data[Moncd][moncd]['+val+'] value='+val+'>');
					  				});
								return false;
								});
$('#buttonxoa').live('click',function(){
	$('#listmoncd :selected').each(function(i, selected) {
        val = $(selected).val();
        text = $(selected).text();
        $("#listmoncd option[value='"+ val +"']").remove();
        $("#listctdtcu").append('<option value='+val+'>'+text+'</option>');
        //alert($("#dsmonthem").html());
        $("#dsmonthem #"+val).remove();
        //$("#dsmonxoa").append('<INPUT TYPE=HIDDEN id='+val+' name=data[Moncd][moncd]['+val+'] value='+val+'>');
			});
	return false;
	});
</script>
<?php }?>